/*
 * Copyright (C) 2014 VenomVendor <info@VenomVendor.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.naizhuai.ui.adapter.business;

import android.content.Context;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.naizhuai.R;
import com.naizhuai.ui.components.CircleImageView;
import com.naizhuai.ui.entity.mainbusiness.TargetDetailsBean;
import com.naizhuai.util.ImageUtils;
import com.naizhuai.util.MathUtils;
import com.naizhuai.util.NaizhuAILog;

import java.util.List;

public class PersonRadarAbilityAdapterHolder extends RecyclerView.Adapter {

    private List<String> abilityList;

    private Context mContext;

    public PersonRadarAbilityAdapterHolder(Context context, List<String> abilityList) {
        this.mContext = context;
        this.abilityList = abilityList;
    }


    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View sView = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_ability_logo_item, parent, false);
        return new AbilityImgHolder(sView);
    }


    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        AbilityImgHolder abilityHolder = (AbilityImgHolder) holder;
        ImageUtils.glideImageViewByUrl(mContext, abilityHolder.imgContent, abilityList.get(position));
    }

    @Override
    public int getItemCount() {
        return abilityList.size();
    }


    public class AbilityImgHolder extends RecyclerView.ViewHolder {
        ImageView imgContent;

        public AbilityImgHolder(View view) {
            super(view);
            imgContent = view.findViewById(R.id.ability_img);
        }

    }

}
